/**
 * phpRaise Javascript Helper file
 *
 * @author Sam Yong
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License v3
 */

var phpRaise = {
    d: document,
    select: function(id){
        return this.d.getElementById(id);
    },
    ajaxCall: function(id, url){
        if(this.select('ajaxcaller' + id)){
            return;
        }else{
            s = this.d.createElement('script');
            s.id = 'ajaxcaller' + id;
            s.setAttribute('src', url);
            this.d.getElementsByTagName('head').item(0).appendChild(s);
        }
    },
    ajaxCallback: function(id, c){
        this.select(id).innerHTML = c;
        this.d.getElementsByTagName('head').item(0).removeChild(this.select('ajaxcaller'+id));
    }
};
